<html>
<head><meta charset="utf-8"><title>tupled upvar types #57482 · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html">tupled upvar types #57482</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="192507736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/192507736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#192507736">(Apr 01 2020 at 10:21)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="128294">@blitzerr</span>, so I <a href="https://github.com/rust-lang/rust/issues/57482#issuecomment-607164261" title="https://github.com/rust-lang/rust/issues/57482#issuecomment-607164261">wrote up instructions</a> for what needs to happen next here.</p>



<a name="192522907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/192522907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#192522907">(Apr 01 2020 at 13:00)</a>:</h4>
<p>Thanks a lot <span class="user-mention" data-user-id="116009">@nikomatsakis</span>  I will take a look</p>



<a name="192934462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/192934462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#192934462">(Apr 05 2020 at 00:48)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  I have added a comment <a href="https://github.com/rust-lang/rust/issues/57482#issuecomment-609109767" title="https://github.com/rust-lang/rust/issues/57482#issuecomment-609109767">here</a>. I was thinking how about we break the rfc into an ordered list of sub-issues so that we have them as the steps to final goal. What do you think ?</p>



<a name="193078220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/193078220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#193078220">(Apr 06 2020 at 17:57)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> seems good, I responded to your comment. Indeed we had already started to do that, as I recall, in the <a href="https://github.com/rust-lang/rust/issues/53488" title="https://github.com/rust-lang/rust/issues/53488">tracking issue</a> -- but we didn't get past <a href="https://github.com/rust-lang/rust/issues/57482" title="https://github.com/rust-lang/rust/issues/57482">#57482</a>. </p>
<p>And, crossing the streams, I see that <span class="user-mention" data-user-id="281950">@Aman Arora</span> and some of their friends were planning on working on this, which is great, seems like reason enough to try and rejuvenate the effort.</p>



<a name="193078339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/193078339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#193078339">(Apr 06 2020 at 17:58)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> can you say a bit about the timeline -- i.e., when would you be expecting to start, how much time do you think you'll have to invest, and how many people are you? (With how much familiarity with Rust and rustc?)</p>



<a name="193085259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/193085259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#193085259">(Apr 06 2020 at 18:53)</a>:</h4>
<p>We will work on it over the next year, accounting for exams and an internship we (3-4 of us) will spend about 4-6 months 5-8hrs/week. We have beginner experience in rust, but are decently familiar with C++.  All of us have taken a basic course on compilers and some of us have also taken courses on type theory. Our current plan is to get better at Rust and try get a E-easy/E-mentor task in my the end of April. Early may we want to make headway on the the RFC. </p>
<p>Ideally we want to finish most it by January.</p>
<p>cc: <span class="user-mention" data-user-id="281952">@Chris Pardy</span></p>



<a name="193086694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/193086694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#193086694">(Apr 06 2020 at 19:03)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> ok -- let me see -- I think we can start to carve out some issues. I'm not sure how "easy" they will be exactly, but I guess you could also pick up some PRs that are unrelated to this work, just to get familiar with Rust codebase.</p>



<a name="193087061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/193087061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#193087061">(Apr 06 2020 at 19:06)</a>:</h4>
<p>It would be nice if the issues that we start with are related but getting to know the code base is what is we are going after with those initial issues.</p>



<a name="193130109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/193130109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#193130109">(Apr 07 2020 at 04:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/193078220" title="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/193078220">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="128294">blitzerr</span> seems good, I responded to your comment. Indeed we had already started to do that, as I recall, in the <a href="https://github.com/rust-lang/rust/issues/53488" title="https://github.com/rust-lang/rust/issues/53488">tracking issue</a> -- but we didn't get past <a href="https://github.com/rust-lang/rust/issues/57482" title="https://github.com/rust-lang/rust/issues/57482">#57482</a>. </p>
</blockquote>
<p>Thanks a lot <span class="user-mention" data-user-id="116009">@nikomatsakis</span> . I have a few questions. I am unsure if I should put them here or on the issue .. For this iteration, I left them on the issue <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="194052120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194052120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194052120">(Apr 15 2020 at 15:54)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> and <span class="user-mention" data-user-id="281952">@Chris Pardy</span> when do y'all plan to start?</p>



<a name="194063166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194063166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Pardy <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194063166">(Apr 15 2020 at 17:18)</a>:</h4>
<p>We are all working full time on internships this term. I don't know when everybody's last day is, but we will all be done work by the end of this month. At that point we can start devoting real time to this project. </p>
<p>So to answer your question directly, May 1st.</p>



<a name="194232620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194232620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194232620">(Apr 15 2020 at 21:52)</a>:</h4>
<p>OK, I better start laying out some plans =)</p>



<a name="194232641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194232641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194232641">(Apr 15 2020 at 21:52)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> did you ever have a chance to look at that issue?</p>



<a name="194236401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194236401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194236401">(Apr 15 2020 at 22:29)</a>:</h4>
<p>I look at that last weekend. I am still thinking if undoing parts of <span class="user-mention" data-user-id="119009">@eddyb</span> 's PR is a good idea. I am trying to think if we can side step that.</p>



<a name="194236410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194236410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194236410">(Apr 15 2020 at 22:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="194236543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194236543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194236543">(Apr 15 2020 at 22:30)</a>:</h4>
<p>which parts?</p>



<a name="194236557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194236557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194236557">(Apr 15 2020 at 22:30)</a>:</h4>
<p>the part where I build a tuple of inference variables is fine to replace</p>



<a name="194236620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194236620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194236620">(Apr 15 2020 at 22:31)</a>:</h4>
<p>Right, that one</p>



<a name="194317628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194317628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194317628">(Apr 16 2020 at 15:02)</a>:</h4>
<p>I think that part has to be undone, I don't see another way</p>



<a name="194329584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194329584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194329584">(Apr 16 2020 at 16:15)</a>:</h4>
<p>Sounds good <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="194462594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/194462594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#194462594">(Apr 17 2020 at 16:01)</a>:</h4>
<p>EDIT: sorry, wrong stream</p>



<a name="195739613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/195739613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#195739613">(Apr 29 2020 at 16:56)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> any jupdates here?</p>



<a name="196226217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/196226217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#196226217">(May 04 2020 at 19:08)</a>:</h4>
<p>I am working on this. There are just a lot of places which needs to be reverted back. <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span> <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="203803798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203803798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203803798">(Jul 14 2020 at 06:57)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> what's the status here? I just opened <a href="https://github.com/rust-lang/rust/issues/74314">#74314</a> which should help (cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span>)</p>



<a name="203803854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203803854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203803854">(Jul 14 2020 at 06:58)</a>:</h4>
<p>it should be even easier now, the hard part is anything assuming the type is a tuple</p>



<a name="203803878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203803878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203803878">(Jul 14 2020 at 06:58)</a>:</h4>
<p>but most things shouldn't be looking at upvars, during inference, I don't think</p>



<a name="203803895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203803895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203803895">(Jul 14 2020 at 06:59)</a>:</h4>
<p>so just defer it and see what breaks <em>shrug</em></p>



<a name="203804275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203804275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203804275">(Jul 14 2020 at 07:05)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>  that's one of next tasks for this RFC. We are trying to get <a href="https://github.com/rust-lang/project-rfc-2229/issues/7">https://github.com/rust-lang/project-rfc-2229/issues/7</a> done first</p>



<a name="203805150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203805150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203805150">(Jul 14 2020 at 07:19)</a>:</h4>
<p>to be clear: this shouldn't be a big thing</p>



<a name="203805175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203805175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203805175">(Jul 14 2020 at 07:19)</a>:</h4>
<p>not sure how it hasn't happened yet</p>



<a name="203805265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203805265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203805265">(Jul 14 2020 at 07:21)</a>:</h4>
<p>I can try to help, maybe, not sure how much time I have in general</p>



<a name="203805544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203805544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203805544">(Jul 14 2020 at 07:26)</a>:</h4>
<p>There is a sync meeting on Zulip scheduled for today (14th July) 3:30pm Eastern Time -- I'll bring this up.</p>



<a name="203873764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203873764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203873764">(Jul 14 2020 at 19:06)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>  Looks like NIko isn't avaiable for the meeting today, I'll bring the tupled upvars next week. </p>
<p>Also we are a bunch of 4th year students working on it as our Design Project. These couple weeks have been busy because of exams and project deliverables, so progress is a little slow. If you think this change needs to go in soon and let me know, and we can priortize it over <a href="https://github.com/rust-lang/project-rfc-2229/issues/7">https://github.com/rust-lang/project-rfc-2229/issues/7</a></p>



<a name="203876997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203876997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203876997">(Jul 14 2020 at 19:34)</a>:</h4>
<p>ah no it's just there shouldn't be a lot of work</p>



<a name="203877085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203877085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203877085">(Jul 14 2020 at 19:34)</a>:</h4>
<p>not to move it to a variable number of upvars, but just making it less eagerly a tuple</p>



<a name="203877560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203877560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203877560">(Jul 14 2020 at 19:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/203877085">said</a>:</p>
<blockquote>
<p>not to move it to a variable number of upvars, but just making it less eagerly a tuple</p>
</blockquote>
<p>One or two of us might have some time this week, I'll bring this up</p>



<a name="203913883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203913883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203913883">(Jul 15 2020 at 03:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/203803798">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="128294">blitzerr</span> what's the status here? I just opened <a href="https://github.com/rust-lang/rust/issues/74314">#74314</a> which should help (cc <span class="user-mention silent" data-user-id="116009">nikomatsakis</span>)</p>
</blockquote>
<p>Sorry for the late response <span class="user-mention" data-user-id="119009">@eddyb</span> .  Unfortunately, I am currently not working on this issue and it is being taken care of by <span class="user-mention" data-user-id="281950">@Aman Arora</span>  and friends. They are making great progress, much better than I did and this will soon be addressed.</p>



<a name="203913903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203913903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203913903">(Jul 15 2020 at 03:44)</a>:</h4>
<p>alright, no worries, good to know</p>



<a name="203913946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/203913946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#203913946">(Jul 15 2020 at 03:44)</a>:</h4>
<p>(I'm not waiting for it or anything, just wanted to make sure it's not stuck on a simple step)</p>



<a name="204217680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204217680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204217680">(Jul 17 2020 at 15:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/203876997">said</a>:</p>
<blockquote>
<p>ah no it's just there shouldn't be a lot of work</p>
</blockquote>
<p>the last time we tried it we got a bit stuck on fixing some diagnostics issues that arose</p>



<a name="204217723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204217723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204217723">(Jul 17 2020 at 15:11)</a>:</h4>
<p>but I don't think it should be so hard to fix, and honestly the "regression" wasn't that bad either</p>



<a name="204217744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204217744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204217744">(Jul 17 2020 at 15:11)</a>:</h4>
<p>basically the backtrace included an extra tuple here and there that we had a hard time suppressing</p>



<a name="204217770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204217770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204217770">(Jul 17 2020 at 15:11)</a>:</h4>
<p>(the backtrace for auto-trait-related errors and the like)</p>



<a name="204233372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204233372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204233372">(Jul 17 2020 at 17:17)</a>:</h4>
<p>hmm</p>



<a name="204233459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204233459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204233459">(Jul 17 2020 at 17:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> because some logic that iterated over tuple fields didn't get to do that?</p>



<a name="204233524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204233524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204233524">(Jul 17 2020 at 17:19)</a>:</h4>
<p>I'd say treat <code>Closure { tupled_upvars: _ }: AutoTrait</code> the same as <code>_: AutoTrait</code> so that it gets retried later</p>



<a name="204233538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204233538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204233538">(Jul 17 2020 at 17:19)</a>:</h4>
<p>and the tuple never leaks</p>



<a name="204233560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204233560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204233560">(Jul 17 2020 at 17:19)</a>:</h4>
<p>at least that seems plausible to me that it would work</p>



<a name="204242694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204242694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204242694">(Jul 17 2020 at 18:38)</a>:</h4>
<p>So, what we did in that first PR was just to have <code>Closure { tupled_upvars: T, }: AutoTrait</code> convert to <code>T: AutoTrait</code> always, which is simpler and I think more the approach I'd prefer. However, we then found it leaked into the trace, so we toying a bit with the "origin" field to know not to print it out, and we never quite got that right.</p>



<a name="204242707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204242707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204242707">(Jul 17 2020 at 18:38)</a>:</h4>
<p>It's true we could just make it delay.</p>



<a name="204242739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204242739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204242739">(Jul 17 2020 at 18:38)</a>:</h4>
<p>I was trying to get the core logic as simple as possible so that we generally passed around the "tupled upvars" type without inspecting it to see that it was a tuple</p>



<a name="204258099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204258099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204258099">(Jul 17 2020 at 20:56)</a>:</h4>
<p>Just want to make sure that we have all the main components here:</p>
<p>1) src/librustc_typechk/check/closure.rs -&gt; creates a tuple of inference variables. This will become just a single inference variable with kind ClosureSynthetic ( can someone confirm the kind?, i'm not sure what synthetic means here)<br>
2) src/librustc_typechk/check/upvar.rs -&gt; fills the the tuple of inference variable with actual types, around the end of analyse_closures. This will now create the tuple with the type infromation and then set the inference variable we had created in <a href="http://closure.rs">closure.rs</a> with this tuple.<br>
3) We will add another method to ClosureSubts to return the <a href="https://github.com/rust-lang/rust/pull/74341/files#diff-4cbc928241996c3226a17d1a924c6ebaR327"><code>tupled_upvars_ty</code></a> directly instead of an iterator.  <br>
4) Before we use the tuple returned we will check <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#method.shallow_resolve"><code>self.infcx.shallow_resolve</code></a><br>
If this fails in trait selection we return Ambigous (and then the compiler figure the trait that later?)<br>
What about if this check fails in other parts of  the compiler? </p>
<p>Should we wrap 3 and 4 together to return Some&lt;T&gt; where it will be Some(Ty&lt;'tcx&gt;) if the tuple has been evaluated/inferred and None otherwise</p>
<p>cc: <span class="user-mention" data-user-id="300388">@Logan Mosier</span> <span class="user-mention" data-user-id="307184">@rocksand</span></p>



<a name="204260104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204260104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204260104">(Jul 17 2020 at 21:15)</a>:</h4>
<p>That sounds roughly correct. I guess that having trait selection return ambiguous is probably a good idea, even if it seems 'less pure' to me. Good enough for now. We'll have to check the other parts of the compiler, in terms of figuring out what they should do. I think one other problem we will encounter is pretty-printing, which doesn't have access to the infcx, but it should just not print out information about the upvars in that case.</p>



<a name="204261942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204261942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204261942">(Jul 17 2020 at 21:30)</a>:</h4>
<p>We can use closure_captures for <a href="http://pretty.rs">pretty.rs</a> because <del>going forward</del> near future they will have type information when they use Place</p>



<a name="204389239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204389239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204389239">(Jul 20 2020 at 06:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281950">Aman Arora</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204261942">said</a>:</p>
<blockquote>
<p>We can use closure_captures for <a href="http://pretty.rs">pretty.rs</a> because <del>going forward</del> near future they will have type information when they use Place</p>
</blockquote>
<p>Actually this is wrong. If the tuple isn't  resolved that means we haven't done capture anlysis, which means we can't use closure_captures</p>



<a name="204390422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204390422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204390422">(Jul 20 2020 at 06:34)</a>:</h4>
<p>you can just not print the captures if they're not there yet</p>



<a name="204390433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204390433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204390433">(Jul 20 2020 at 06:35)</a>:</h4>
<p>I think the current code should already be fine? like IIRC that's why <code>is_valid</code> even exists</p>



<a name="204390440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204390440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204390440">(Jul 20 2020 at 06:35)</a>:</h4>
<p>if it's confusing we could rename it</p>



<a name="204390511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204390511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204390511">(Jul 20 2020 at 06:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204390422">said</a>:</p>
<blockquote>
<p>you can just not print the captures if they're not there yet</p>
</blockquote>
<p>Exactly.</p>



<a name="204390554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204390554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204390554">(Jul 20 2020 at 06:37)</a>:</h4>
<p>like that's what this does <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/print/pretty.rs#L678-L685">https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/print/pretty.rs#L678-L685</a></p>



<a name="204390644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204390644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204390644">(Jul 20 2020 at 06:39)</a>:</h4>
<p>Okay that's better, I thought it only checked we had atleast three entried. This is better than shallow_resolve, because we don't need <code>infcx</code> anymore</p>



<a name="204394752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204394752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204394752">(Jul 20 2020 at 07:49)</a>:</h4>
<p>I think the only reason it even checks that is to not panic while checking the thing it wants to check</p>



<a name="204394754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204394754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204394754">(Jul 20 2020 at 07:49)</a>:</h4>
<p>allowing some level of debugging :P</p>



<a name="204394842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204394842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204394842">(Jul 20 2020 at 07:50)</a>:</h4>
<p>and yeah it would be impossible rn to make printing work with inference. well, less impossible than a while back but still hard. there's no good solution for this, you either double down on hacks, or you make a lot of diagnostics generation more explicit</p>



<a name="204394862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204394862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204394862">(Jul 20 2020 at 07:51)</a>:</h4>
<p>(but maybe we want something like <code>format_args!</code> that is specialized to diagnostics and plumbs through relevant context around)</p>



<a name="204396843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204396843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204396843">(Jul 20 2020 at 08:20)</a>:</h4>
<p>What do you mean by diagnostic generation? Like just more information about the current stage/pass of the compiler to print produce better information for debugging?</p>



<a name="204396858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204396858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204396858">(Jul 20 2020 at 08:20)</a>:</h4>
<p>no, "diagnostics" specifically refers to warnings/errors output to the user</p>



<a name="204396871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204396871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204396871">(Jul 20 2020 at 08:21)</a>:</h4>
<p>or at least I like to think we use it consistently :P</p>



<a name="204396980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204396980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204396980">(Jul 20 2020 at 08:22)</a>:</h4>
<p>I see</p>



<a name="204396988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204396988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204396988">(Jul 20 2020 at 08:22)</a>:</h4>
<p>that makes sense</p>



<a name="204397006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204397006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204397006">(Jul 20 2020 at 08:22)</a>:</h4>
<p>because they're the main reason we print types (and other typesystem entities), we could use macros to make it more easy for inference information to be available to e.g. <code>ty::print::pretty</code></p>



<a name="204397036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204397036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204397036">(Jul 20 2020 at 08:23)</a>:</h4>
<p>I think almost all of the printing is either for user-facing diagnostics, or <code>debug!</code> logging, and we could arguably specialize each of them for those usecases</p>



<a name="204397044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204397044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204397044">(Jul 20 2020 at 08:23)</a>:</h4>
<p>but I am not aware of any plans to do so any time soon</p>



<a name="204454457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204454457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204454457">(Jul 20 2020 at 17:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204397036">said</a>:</p>
<blockquote>
<p>I think almost all of the printing is either for user-facing diagnostics, or <code>debug!</code> logging, and we could arguably specialize each of them for those usecases</p>
</blockquote>
<p>yes, I think we really want two distinct paths...</p>



<a name="204454465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204454465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204454465">(Jul 20 2020 at 17:59)</a>:</h4>
<p>...but that'd be a lot of work</p>



<a name="204587070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204587070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204587070">(Jul 21 2020 at 18:49)</a>:</h4>
<p>So this might be dumb question but if I understand the code <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/upvar.rs#L90">here</a></p>
<p>We have an immutable copy of ClosureSubsts that hold immutable reference to the internal substs.</p>
<p>And code here is what checks if the types can be unified? <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/upvar.rs#L205">https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/upvar.rs#L205</a></p>
<p>Since the substs copy we have,  has immut reference to the Internal Substs. Will it/How does it update the substs (not the copy) to be the correct bound/resolved type?  Call to demand_suptype also uses a immut reference to the function context, so don't see it update any inference tables (Not sure how they are stored, table is a guess here). <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html#method.demand_suptype">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html#method.demand_suptype</a></p>
<p>Because I'm trying to figure out if <code>is_valid</code> will start returning correct results or do we need to call shallow_resolve on the  substs at some point</p>



<a name="204593781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204593781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204593781">(Jul 21 2020 at 19:41)</a>:</h4>
<blockquote>
<p>And code here is what checks if the types can be unified? <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/upvar.rs#L205">https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/upvar.rs#L205</a></p>
</blockquote>
<p>Well, sort of, I that these unifications can never fail, because the upvar types are always unbound until the unification occurs. But I misremembering some detail.</p>



<a name="204593895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204593895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204593895">(Jul 21 2020 at 19:42)</a>:</h4>
<blockquote>
<p>Since the substs copy we have, has immut reference to the Internal Substs. Will it/How does it update the substs (not the copy) to be the correct bound/resolved type? </p>
</blockquote>
<p>So, it never "updates the type". The type remains the same -- it is a reference to the inference variable. <em>But the state  of the inference variable changes</em> to be bound.</p>



<a name="204593914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204593914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204593914">(Jul 21 2020 at 19:42)</a>:</h4>
<p>The state of the inference variables is stored in a <code>RefCell</code> inside the <code>InferCtxt</code></p>



<a name="204593947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204593947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204593947">(Jul 21 2020 at 19:42)</a>:</h4>
<p>When we talk about "resolving" an inference variable, it means replacing the variable with the type to which it is bound</p>



<a name="204593979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204593979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204593979">(Jul 21 2020 at 19:43)</a>:</h4>
<p>The "writeback" phase of type checking, which comes at the very end, replaces all inference variables with the types to which they were ultimately bound</p>



<a name="204593994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204593994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204593994">(Jul 21 2020 at 19:43)</a>:</h4>
<p>But this happens outside of upvar inference</p>



<a name="204594178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204594178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204594178">(Jul 21 2020 at 19:44)</a>:</h4>
<blockquote>
<p>I'm trying to figure out if is_valid will start returning correct results or do we need to call shallow_resolve on the substs at some point</p>
</blockquote>
<p>If <code>is_valid</code> is just testing if this is an inference variable, you will need to call <code>shallow_resolve</code> (that name, as a side note, could be clearer...)</p>



<a name="204594273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204594273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204594273">(Jul 21 2020 at 19:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204594178">said</a>:</p>
<blockquote>
<blockquote>
<p>I'm trying to figure out if is_valid will start returning correct results or do we need to call shallow_resolve on the substs at some point</p>
</blockquote>
<p>If <code>is_valid</code> is just testing if this is an inference variable, you will need to call <code>shallow_resolve</code> (that name, as a side note, could be clearer...)</p>
</blockquote>
<p>Yeah is valid checks if the susts.upvars_ty_tuple is a tuple or not</p>



<a name="204594930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204594930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204594930">(Jul 21 2020 at 19:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204593979">said</a>:</p>
<blockquote>
<p>The "writeback" phase of type checking, which comes at the very end, replaces all inference variables with the types to which they were ultimately bound</p>
</blockquote>
<p>This makes sense, I forgot about that step</p>



<a name="204595034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595034">(Jul 21 2020 at 19:51)</a>:</h4>
<p>I'm assuming once write back is done we won't require shallow_resolve? Also when does the trait_selection code run</p>



<a name="204595293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595293">(Jul 21 2020 at 19:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281950">Aman Arora</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204595034">said</a>:</p>
<blockquote>
<p>I'm assuming once write back is done we won't require shallow_resolve? </p>
</blockquote>
<p>Correct</p>
<blockquote>
<p>Also when does the trait_selection code run</p>
</blockquote>
<p>both before and after writeback</p>



<a name="204595375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595375">(Jul 21 2020 at 19:54)</a>:</h4>
<p>And when/how can a user  run <a href="http://pretty.rs">pretty.rs</a>? It is defined as part of librustc_mir, so my inital expectation is it deals with things around time we are building MIR and typeck/inference information would've ideally resolved</p>



<a name="204595380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595380">(Jul 21 2020 at 19:54)</a>:</h4>
<p>one option would be to add a method like <code>upvar_types(cx: &amp;InferCtxt) -&gt; Option&lt;&amp;[Ty]&gt;</code> or something</p>



<a name="204595412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595412">(Jul 21 2020 at 19:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204595380">said</a>:</p>
<blockquote>
<p>one option would be to add a method like <code>upvar_types(cx: &amp;InferCtxt) -&gt; Option&lt;&amp;[Ty]&gt;</code> or something</p>
</blockquote>
<p>Yeah that's something I was thinking as well</p>



<a name="204595413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595413">(Jul 21 2020 at 19:54)</a>:</h4>
<p>and have another method that <em>asserts</em> that they are inferred, and is only meant to be used when you know that writeback has occcurred</p>



<a name="204595417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595417">(Jul 21 2020 at 19:54)</a>:</h4>
<p>I think this is what we did initially</p>



<a name="204595461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595461">(Jul 21 2020 at 19:55)</a>:</h4>
<p><a href="http://pretty.rs">pretty.rs</a> .. I'm not sure what that is anymore, is that type pretty printing?</p>



<a name="204595473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595473">(Jul 21 2020 at 19:55)</a>:</h4>
<p>if so, it runs all the time and has to be prepared for anything</p>



<a name="204595491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595491">(Jul 21 2020 at 19:55)</a>:</h4>
<p>which is a pain in the neck sometimes :)</p>



<a name="204595706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595706">(Jul 21 2020 at 19:57)</a>:</h4>
<p>nvm it's rust middle, and I yes it's printing type info</p>



<a name="204595805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595805">(Jul 21 2020 at 19:58)</a>:</h4>
<p>Since we don't have infcx context we can just let is_valid fail here for pre-writeback printing</p>



<a name="204595816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595816">(Jul 21 2020 at 19:58)</a>:</h4>
<p>yeah that should be fine</p>



<a name="204595839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595839">(Jul 21 2020 at 19:58)</a>:</h4>
<p>honestly dumping out the types of all the upvars.. I'm not sure how helpful it is</p>



<a name="204595842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595842">(Jul 21 2020 at 19:58)</a>:</h4>
<p>I can imagine it can be</p>



<a name="204595847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595847">(Jul 21 2020 at 19:58)</a>:</h4>
<p>but it's also a lot of verbosity for users</p>



<a name="204595856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595856">(Jul 21 2020 at 19:58)</a>:</h4>
<p>I bet it does more harm than good</p>



<a name="204595861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595861">(Jul 21 2020 at 19:58)</a>:</h4>
<p>but that's a discussion for another time :)</p>



<a name="204595924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204595924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204595924">(Jul 21 2020 at 19:59)</a>:</h4>
<p>Also looking at the code, it alreayd checks <code>is_valid</code>, so that really doesn't need to change lol</p>



<a name="204596540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204596540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204596540">(Jul 21 2020 at 20:04)</a>:</h4>
<p>yeah I was explaining that earlier, I had to add that so that e.g. <code>debug!</code> printing when the type isn't known at all doesn't ICE</p>



<a name="204596584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204596584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204596584">(Jul 21 2020 at 20:04)</a>:</h4>
<p>we thankfully have a test that runs the compiler with a <code>RUSTC_LOG</code> value that will catch stuff like that :P</p>



<a name="204596642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204596642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204596642">(Jul 21 2020 at 20:04)</a>:</h4>
<p>could rename <code>is_valid</code> to something else, no idea. the name is too general anyway</p>



<a name="204596681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204596681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204596681">(Jul 21 2020 at 20:05)</a>:</h4>
<p><code>is_shallowly_known</code> maybe <em>shrug</em></p>



<a name="204597223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204597223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204597223">(Jul 21 2020 at 20:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204595413">said</a>:</p>
<blockquote>
<p>and have another method that <em>asserts</em> that they are inferred, and is only meant to be used when you know that writeback has occcurred</p>
</blockquote>
<p><del>From a quick sweep I think, this is only being used in trait_selection. Unless there are parts of trait selection that run only after writeback, not sure if this will be helpful</del> This is super incorrect, ignore this</p>



<a name="204597368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204597368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204597368">(Jul 21 2020 at 20:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204596540">said</a>:</p>
<blockquote>
<p>yeah I was explaining that earlier, I had to add that so that e.g. <code>debug!</code> printing when the type isn't known at all doesn't ICE</p>
</blockquote>
<p>I see what you mean now, I confused it for we can rely on is_valid being correct all the time. by bad</p>



<a name="204599587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204599587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204599587">(Jul 21 2020 at 20:31)</a>:</h4>
<p>I kinda did a poor job, should've come up with a better name and docs for that hack (I basically wanted to not bother exposing the tupled type to <code>ty::print::pretty</code>)</p>



<a name="204602555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204602555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204602555">(Jul 21 2020 at 21:03)</a>:</h4>
<p>How about names like <code>is_resolved</code> or <code>is_inferred</code>, with comment about this returns true  only after typeck writeback stage is complete.</p>
<p>Or something more explicit <code>is_post_writeback</code></p>



<a name="204603220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603220">(Jul 21 2020 at 21:09)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> that's not even the problem I was solving, which is that closures types can exist in an unsubstituted form for a brief moment, and there is at least one <code>debug!</code> that will try to print that form</p>



<a name="204603248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603248">(Jul 21 2020 at 21:09)</a>:</h4>
<p>that's why I'd use "known". maybe "complete" would work too</p>



<a name="204603356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603356">(Jul 21 2020 at 21:11)</a>:</h4>
<p>Yeah also not just debug statements, coerce relies on it too:<br>
<a href="https://github.com/rust-lang/rust/commit/2c8aef2316284cc90d27fae707586552e8679511">https://github.com/rust-lang/rust/commit/2c8aef2316284cc90d27fae707586552e8679511</a></p>



<a name="204603369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603369">(Jul 21 2020 at 21:11)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> we could just grab the tupled upvars type and check it against <code>ty::Tuple(_)</code> with <code>matches!</code> in <code>pretty</code> if there are no other users</p>



<a name="204603377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603377">(Jul 21 2020 at 21:11)</a>:</h4>
<p>oh, spoke too soon?</p>



<a name="204603397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603397">(Jul 21 2020 at 21:11)</a>:</h4>
<p>ah that's different</p>



<a name="204603457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603457">(Jul 21 2020 at 21:12)</a>:</h4>
<p>the fix there makes sense I guess</p>



<a name="204603521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204603521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204603521">(Jul 21 2020 at 21:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204603369">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="281950">Aman Arora</span> we could just grab the tupled upvars type and check it against <code>ty::Tuple(_)</code> with <code>matches!</code> in <code>pretty</code> if there are no other users</p>
</blockquote>
<p>I think this is better just because it's more explicit</p>



<a name="204605383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204605383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204605383">(Jul 21 2020 at 21:33)</a>:</h4>
<p>Not the <a href="http://pretty.rs">pretty.rs</a> problem but as niko suggested we probably should've two sets of api one that asserts that the type has been resolved. </p>
<p>The error message when debugging the coerce issue wasn't hard to track using traceback, but it would've been nice to know why it was erroring out. </p>
<p>Also currently the error is thrown by <code>bug!</code> about some method on non tuple type, which has the formatting and writer stuff at the top of the traceback where as assert will just be a clean this failed and comment around the assert can explain that the tuple  is not resolved</p>



<a name="204605811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204605811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204605811">(Jul 21 2020 at 21:38)</a>:</h4>
<p>not sure what you mean tbh, backtraces always start with like a dozen unnecessary frames</p>



<a name="204606014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204606014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204606014">(Jul 21 2020 at 21:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204605811">said</a>:</p>
<blockquote>
<p>not sure what you mean tbh, backtraces always start with like a dozen unnecessary frames</p>
</blockquote>
<p>and assert failure would much more noticable</p>



<a name="204606100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204606100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204606100">(Jul 21 2020 at 21:41)</a>:</h4>
<p>but the assert would also have that kind of stuff on it?</p>



<a name="204606152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204606152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204606152">(Jul 21 2020 at 21:42)</a>:</h4>
<p>if you show me a backtrace I can probably understand easier what the problem is</p>



<a name="204606198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204606198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204606198">(Jul 21 2020 at 21:42)</a>:</h4>
<p>(there's also <code>#[track_caller]</code>, look at how I've used it on <code>fn typeck_results</code> methods to get better quality ICEs)</p>



<a name="204606309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204606309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204606309">(Jul 21 2020 at 21:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204606152">said</a>:</p>
<blockquote>
<p>if you show me a backtrace I can probably understand easier what the problem is</p>
</blockquote>
<p>I guess point was if we have asserts fail we won't need the backtrace</p>



<a name="204607672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204607672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204607672">(Jul 21 2020 at 21:59)</a>:</h4>
<p>aaaaaah</p>



<a name="204607693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204607693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204607693">(Jul 21 2020 at 21:59)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> that's not assert vs bug, it's <code>#[track_caller]</code> vs not :P</p>



<a name="204607720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204607720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204607720">(Jul 21 2020 at 21:59)</a>:</h4>
<p>although which <code>bug!</code> gives you a not useful location?</p>



<a name="204607835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204607835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204607835">(Jul 21 2020 at 22:00)</a>:</h4>
<p>I don't think I'm understanding where it fails that makes it worse for debugging</p>



<a name="204608323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204608323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204608323">(Jul 21 2020 at 22:06)</a>:</h4>
<p>Nvm I incorrectly rememberedd error message with assert was, I remember seeing a caller somewhere. Sorry for derailing the conversation</p>



<a name="204755889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204755889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204755889">(Jul 23 2020 at 02:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/tupled.20upvar.20types.20.2357482/near/204595380">said</a>:</p>
<blockquote>
<p>one option would be to add a method like <code>upvar_types(cx: &amp;InferCtxt) -&gt; Option&lt;&amp;[Ty]&gt;</code> or something</p>
</blockquote>
<p>If I'm not wrong this is expected to be part of the ClosureSubsts api?</p>
<p>That is defined in middle and rustc_infer depends on middle.So circular dependency<br>
so either we need to move the substs to another create or have sort of a util function in the infer crate.</p>



<a name="204761228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204761228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204761228">(Jul 23 2020 at 05:10)</a>:</h4>
<p>the traditional thing is a method on <code>InferCtxt</code></p>



<a name="204761236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204761236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204761236">(Jul 23 2020 at 05:10)</a>:</h4>
<p>like we used to have this</p>



<a name="204762264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204762264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204762264">(Jul 23 2020 at 05:37)</a>:</h4>
<p>Can u point me to it? Also why was it removed?</p>



<a name="204779622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779622">(Jul 23 2020 at 10:09)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I think look at <code>closure_kind</code>? we should still have something closure-related on <code>InferCtxt</code>. I removed at least one method because it became unnecessary, I think?</p>



<a name="204779631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779631">(Jul 23 2020 at 10:09)</a>:</h4>
<p>I could be misremembering  though</p>



<a name="204779727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779727">(Jul 23 2020 at 10:10)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/e8b55a4ad230ebec762fdfc4f241ba98a98560af/src/librustc_infer/infer/mod.rs#L1499">https://github.com/rust-lang/rust/blob/e8b55a4ad230ebec762fdfc4f241ba98a98560af/src/librustc_infer/infer/mod.rs#L1499</a></p>



<a name="204779780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779780">(Jul 23 2020 at 10:10)</a>:</h4>
<p>hmm I changed its signature <a href="https://github.com/rust-lang/rust/commit/10f08abd2e27785496ddfe92a9e6a4f9cd18443d#diff-d2b6d3d8d756534498ab3927843ebcbaL1499-R1500">https://github.com/rust-lang/rust/commit/10f08abd2e27785496ddfe92a9e6a4f9cd18443d#diff-d2b6d3d8d756534498ab3927843ebcbaL1499-R1500</a></p>



<a name="204779794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779794">(Jul 23 2020 at 10:11)</a>:</h4>
<p>but I guess didn't remove anything</p>



<a name="204779830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779830">(Jul 23 2020 at 10:11)</a>:</h4>
<p>aaah we used to have <code>closure_sig</code>, that's what got removed</p>



<a name="204779835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204779835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204779835">(Jul 23 2020 at 10:11)</a>:</h4>
<p>apparently nothing about upvars</p>



<a name="204809594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204809594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204809594">(Jul 23 2020 at 15:06)</a>:</h4>
<p>I don't have a strong opinion about whether to write <code>infcx.closure_upvar_tys(substs)</code> or the reverse, but I would say that <code>substs.upvar_tys(infcx)</code> seems more 'discoverable' to me</p>



<a name="204809707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204809707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204809707">(Jul 23 2020 at 15:06)</a>:</h4>
<p>but if there is a rustdoc comment pointing back-and-forth that perhaps suffices</p>



<a name="204820476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204820476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204820476">(Jul 23 2020 at 16:29)</a>:</h4>
<p>I'll take a look later, the substs.upvars... api wont be feasible until we handle the circular dependency</p>



<a name="204872304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/204872304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#204872304">(Jul 24 2020 at 01:53)</a>:</h4>
<p>I think we should rename some of these closure substs apis to be <code>capture_</code> so that it denotes that the information is about what the closure captures and not the root variables that were mentioned. </p>
<p>This is similar to how we renamed the map in typeck tables to from upvars to closure_captues. Closure_captures is also generated along with/where the upvars_ty (captures_ty if we rename it) inference  will now  happen</p>



<a name="211507503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/211507503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#211507503">(Sep 28 2020 at 15:24)</a>:</h4>
<p>We now have most testings _passing_.</p>
<p><a href="https://github.com/sexxi-goose/rust/pull/23">https://github.com/sexxi-goose/rust/pull/23</a> (needs some cleaning)</p>
<ul>
<li>issue-70818 is failing (PR has the updated failing .stderr)</li>
<li>add an extra to the error output (don't think that is entierly incorrect, other than the last last element of the tuple missing) <br>
    - src/test/ui/no-send-res-ports.stderr<br>
    - src/test/ui/kindck/kindck-nonsendable-1.stderr<br>
    - src/test/ui/interior-mutability/interior-mutability.stderr<br>
    -  src/test/ui/generator/not-send-sync.stderr</li>
</ul>
<p>The upvar printing diffs here will go away once closure printing is merged</p>



<a name="211547078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/211547078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#211547078">(Sep 28 2020 at 20:37)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="307184">@rocksand</span></p>



<a name="213093374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/213093374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#213093374">(Oct 12 2020 at 22:42)</a>:</h4>
<p>PR for this is up</p>
<p><a href="https://github.com/rust-lang/rust/pull/77873">https://github.com/rust-lang/rust/pull/77873</a></p>
<p>I think the r? Didn't work.</p>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> </p>
<p>cc: <span class="user-mention" data-user-id="128294">@blitzerr</span> in case you're curious what happened to this <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="213105974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/213105974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#213105974">(Oct 13 2020 at 02:28)</a>:</h4>
<p>Thanks a lot <span class="user-mention" data-user-id="281950">@Aman Arora</span> I was curious. <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="213164075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/213164075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#213164075">(Oct 13 2020 at 14:36)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I left some comments btw</p>



<a name="213171154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/213171154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#213171154">(Oct 13 2020 at 15:18)</a>:</h4>
<p>Thanks, Roxane is planning on address them tonight</p>



<a name="214133942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214133942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214133942">(Oct 22 2020 at 01:11)</a>:</h4>
<p>This resulted in an ICE, <a href="https://github.com/rust-lang/rust/issues/77993">https://github.com/rust-lang/rust/issues/77993</a></p>



<a name="214133990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214133990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214133990">(Oct 22 2020 at 01:12)</a>:</h4>
<p>Can get a fix in over the weekend</p>



<a name="214134209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214134209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214134209">(Oct 22 2020 at 01:16)</a>:</h4>
<p>I think we should also switch our if cases to  <code>if (subssts. ... tupled(), Ty::Tuple)</code>, though not sure when we will end up with TyKind::Error there.</p>



<a name="214191224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214191224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214191224">(Oct 22 2020 at 14:02)</a>:</h4>
<p>interesting</p>



<a name="214191247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214191247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214191247">(Oct 22 2020 at 14:02)</a>:</h4>
<p>we should probably be prepared for error regardless</p>



<a name="214191290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214191290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214191290">(Oct 22 2020 at 14:03)</a>:</h4>
<p>if we see an <em>error</em> I think returning an empty iterator <em>probably</em> makes sense</p>



<a name="214191305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214191305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214191305">(Oct 22 2020 at 14:03)</a>:</h4>
<p>(though it might lead to some weird diagnostics or other behavior)</p>



<a name="214191333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214191333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214191333">(Oct 22 2020 at 14:03)</a>:</h4>
<p>this is always kind of annoying; ideal would probably be to return a <code>Result&lt;&gt;</code> but that may be annoying in practice</p>



<a name="214572659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214572659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214572659">(Oct 26 2020 at 13:28)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I left a <a href="https://github.com/rust-lang/rust/pull/78392#pullrequestreview-516768171">review comment</a> on PR <a href="https://github.com/rust-lang/rust/issues/78392">#78392</a></p>



<a name="214589752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214589752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214589752">(Oct 26 2020 at 15:37)</a>:</h4>
<p>So Roxane and I tried doing the Result on upvar_tys, but we weren't able to get that to work. </p>
<p>I think main reason behind that was tuple_fieleds returns an impl Trait which is opaque, so returning an Err from that function didn't quite work out</p>
<p>Also since it breaks some production tests (and looks like multiple people have encountered this), we wanted to have some fix out soon as we continue to refine it to be more future proof code</p>



<a name="214607852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214607852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214607852">(Oct 26 2020 at 17:37)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> ah, I see</p>



<a name="214607878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214607878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214607878">(Oct 26 2020 at 17:37)</a>:</h4>
<p>ok, then I am willing to r+ with some more comments</p>



<a name="214608562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214608562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214608562">(Oct 26 2020 at 17:43)</a>:</h4>
<p>Is this regarding the quick fix or returning Result from upvar_tys ? The latter might be because of my less experience with Rust so if you have any suggestions we can try for Result there, we can try that out tonight as well</p>



<a name="214663167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214663167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214663167">(Oct 27 2020 at 05:42)</a>:</h4>
<p>I pushed a fixup with the comments. </p>
<p>Also just read the return type here, <a href="https://github.com/sexxi-goose/rust/blob/master/compiler/rustc_mir/src/borrow_check/universal_regions.rs#L118-L128">https://github.com/sexxi-goose/rust/blob/master/compiler/rustc_mir/src/borrow_check/universal_regions.rs#L118-L128</a></p>
<p>This should solve the opaque tys problem but I'm not 100% sure how this works + this would add an additional dependency on rustc_middle.</p>
<p>I can do a take-3 on a fix here tomorrow, using this approach with Eiterh</p>



<a name="214663636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214663636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214663636">(Oct 27 2020 at 05:56)</a>:</h4>
<p>Actually does it work out because the type returned from the match is Either&lt;imp Iter, Either &lt;impl Iter, impl Iter&gt;&gt; which kind of allows us to have 3 different iterators there. </p>
<p>and the implementation of Iterator kind of handles the part of dealing with Iterators being in left of right. It's pretty neatly  done with macros <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<a name="214667061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214667061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214667061">(Oct 27 2020 at 07:17)</a>:</h4>
<p>Just finished this, but here is PR with modified upvars_ty which returns empty iterator. If tests fail and we need to handle things more properly in some places I'll convert this into a result. <a href="https://github.com/rust-lang/rust/pull/78432">https://github.com/rust-lang/rust/pull/78432</a></p>



<a name="214695915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214695915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214695915">(Oct 27 2020 at 13:06)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> left a comment on that PR, but I couldn't quite tell whether it is meant as an alternative to <a href="https://github.com/rust-lang/rust/pull/78392">https://github.com/rust-lang/rust/pull/78392</a> ?</p>



<a name="214695921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214695921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214695921">(Oct 27 2020 at 13:06)</a>:</h4>
<p>(I think it could be)</p>



<a name="214721350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214721350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214721350">(Oct 27 2020 at 16:00)</a>:</h4>
<p>that would work, not sure why I disregarded this idea earlier</p>



<a name="214861790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214861790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214861790">(Oct 28 2020 at 16:26)</a>:</h4>
<p>Fyi we pushed a fix-up last night <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="214890489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/214890489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#214890489">(Oct 28 2020 at 20:04)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> i r+'d <a href="https://github.com/rust-lang/rust/issues/78432">#78432</a></p>



<a name="215514027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/215514027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#215514027">(Nov 03 2020 at 21:48)</a>:</h4>
<p>So the fix seems to have improved some benchmarks <a href="https://github.com/rust-lang/rust/pull/78432#issuecomment-721388323">https://github.com/rust-lang/rust/pull/78432#issuecomment-721388323</a></p>



<a name="215566181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/215566181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#215566181">(Nov 04 2020 at 10:58)</a>:</h4>
<p>Also this PR had another ICE, I have a fix here: <a href="https://github.com/rust-lang/rust/pull/78725">https://github.com/rust-lang/rust/pull/78725</a></p>
<p>I'm concerned that this might not be future proof, since someone can call upvar_tys without having read the updated docs. </p>
<p>We had kind of discussed this previously, something around, adding an API to infcx to do the shallow_resolve before calling upvar_tys. If it's an inference variable it returns an empty iterator.</p>
<p>Maybe we replace upvar_tys with that across the compiler. I haven't gotten a to check if this possible everywhere (i.e. we have access to infcx everywhere)</p>



<a name="215581894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/215581894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#215581894">(Nov 04 2020 at 13:47)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I <a href="https://github.com/rust-lang/rust/pull/78725#issuecomment-721741228">left a comment</a> here -- in general I'd prefer to rewrite things to operate on <code>tupled_upvars_ty</code> where we can, as that is just more robust</p>



<a name="215581903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/215581903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#215581903">(Nov 04 2020 at 13:47)</a>:</h4>
<p>I think there are many places we can</p>



<a name="215622580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/215622580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#215622580">(Nov 04 2020 at 18:31)</a>:</h4>
<p>Yeah I think the regression happened because we were trying to move towards tupled_upvar_tys but missed to remove the upvar_tys call</p>



<a name="215915282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/215915282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#215915282">(Nov 06 2020 at 23:05)</a>:</h4>
<p>I was reviewing the video from yesterday and you had mentioned that you'll be sharing some pattern that might be useful for work that needs to be done for the fix here. Just posting this here as a reminder for that</p>



<a name="216091067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216091067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216091067">(Nov 09 2020 at 14:31)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> hmm I'm not sure what I meant :P</p>



<a name="216091190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216091190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216091190">(Nov 09 2020 at 14:32)</a>:</h4>
<p>do you remember more specifically what problem we were trying to address?</p>



<a name="216104948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216104948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216104948">(Nov 09 2020 at 16:05)</a>:</h4>
<p>We were discussing using tupled_upvar_tys everywhere possible</p>



<a name="216105003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216105003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216105003">(Nov 09 2020 at 16:05)</a>:</h4>
<p>Instead of upvar_tys</p>



<a name="216111089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216111089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216111089">(Nov 09 2020 at 16:46)</a>:</h4>
<p>You mentioned that it was based on another pr you reviewed on Thursday</p>



<a name="216124546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216124546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216124546">(Nov 09 2020 at 18:24)</a>:</h4>
<p>hmm</p>



<a name="216124553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216124553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216124553">(Nov 09 2020 at 18:25)</a>:</h4>
<p>so I left a comment on some PR about this</p>



<a name="216124574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216124574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216124574">(Nov 09 2020 at 18:25)</a>:</h4>
<p>is that what you mean?</p>



<a name="216124820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216124820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216124820">(Nov 09 2020 at 18:27)</a>:</h4>
<p><a href="https://youtu.be/-8simqmm8t4">https://youtu.be/-8simqmm8t4</a></p>
<div class="youtube-video message_inline_image"><a data-id="-8simqmm8t4" href="https://youtu.be/-8simqmm8t4"><img src="https://i.ytimg.com/vi/-8simqmm8t4/default.jpg"></a></div>



<a name="216124838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216124838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216124838">(Nov 09 2020 at 18:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> first 30secs-1min here</p>



<a name="216124926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216124926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216124926">(Nov 09 2020 at 18:28)</a>:</h4>
<p>I think what you were going for was a way for making sure no more issues pop up around upvar_tys</p>



<a name="216125227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216125227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216125227">(Nov 09 2020 at 18:30)</a>:</h4>
<p>yeah ok I think I was thinking that <code>upvar_tys</code> could return a <code>Result</code></p>



<a name="216125235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216125235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216125235">(Nov 09 2020 at 18:31)</a>:</h4>
<p>or just an empty iterator</p>



<a name="216125257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216125257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216125257">(Nov 09 2020 at 18:31)</a>:</h4>
<p>the latter is easier but a bit less "safe"</p>



<a name="216125275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216125275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216125275">(Nov 09 2020 at 18:31)</a>:</h4>
<p>When it's an Infer?</p>



<a name="216125398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216125398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216125398">(Nov 09 2020 at 18:31)</a>:</h4>
<p>We already return empty if it's error, we bug on ty:: Infer</p>



<a name="216381004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216381004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216381004">(Nov 11 2020 at 18:24)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ^</p>



<a name="216387882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216387882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216387882">(Nov 11 2020 at 19:24)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> Ah. I would expect us to continue to <code>bug!</code> on things besides tuple and err</p>



<a name="216387894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216387894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216387894">(Nov 11 2020 at 19:25)</a>:</h4>
<p>since it should not be used when inference variables are a possibility</p>



<a name="216388519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/216388519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#216388519">(Nov 11 2020 at 19:31)</a>:</h4>
<p>ok, sounds good</p>



<a name="217363966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/217363966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#217363966">(Nov 20 2020 at 05:25)</a>:</h4>
<p>Roxane pushed the fix. This was a stable -&gt; nightly regression and we cut beta recently. Do we want to beta backport this?</p>



<a name="217465287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/217465287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#217465287">(Nov 20 2020 at 22:10)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> where was the fix pushed?</p>



<a name="217465315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/217465315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#217465315">(Nov 20 2020 at 22:10)</a>:</h4>
<p>the PR itself</p>



<a name="217465362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/217465362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#217465362">(Nov 20 2020 at 22:11)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/78725">https://github.com/rust-lang/rust/pull/78725</a></p>



<a name="217466077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/217466077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#217466077">(Nov 20 2020 at 22:19)</a>:</h4>
<p>nvm there is a merge conflict, lemme ask her to take a look again</p>



<a name="218359118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/tupled%20upvar%20types%20%2357482/near/218359118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/tupled.20upvar.20types.20.2357482.html#218359118">(Nov 30 2020 at 23:04)</a>:</h4>
<p>Also <span class="user-mention" data-user-id="116009">@nikomatsakis</span>  can take a look again at  this PR? Thanks</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>